﻿using Essensoft.Paylink.Alipay;
using Essensoft.Paylink.WeChatPay;

namespace Pay.DTO
{
	/// <summary>
	/// 支付配置
	/// </summary>
	public class PayConfigDto
	{
        /// <summary>
        /// 支付类型
        /// </summary>
        public PayCategoryEnum PayCategory { get; set; }

        /// <summary>
        /// 应用appid,多个以英文逗号隔开
        /// </summary>
        public string AppId { get; set; }

        /// <summary>
        /// 支付类型描述
        /// </summary>
        public string PayCategoryDesc => PayCategory.ToDescription();

        /// <summary>
        /// 支付服务器对外公共IP
        /// </summary>
        public string ServerIp { get; set; }

		private string _wechatVer = "V2";
        /// <summary>
        /// 微信支付时，默认V2;版本号 V2、V3
        /// </summary>
        public string WechatPayVersion
        {
            get { return _wechatVer; }
            set
            {
                if (value?.ToUpperInvariant() == "V3")
                    _wechatVer = "V3";
                else
                    _wechatVer = "V2";
            }
        }

        /// <summary>
        /// 支付宝支付配置
        /// </summary>
        public AlipayOptions? AlipayOption { get; set; }

		/// <summary>
		/// 微信支付配置
		/// </summary>
		public WeChatPayOptions? WeChatPayOption { get; set; }
	}
}